package cn.wildfire.chat.app.extendsion.classes;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Create by HEKE, 2019/9/23 16:18
 * TODO 用户卡片(个人名片)
 */
public class UserCard extends GsonObject implements Parcelable {

    public String userId;
    public String userName;
    public String portraitUrl;

    public UserCard() {
    }

    public UserCard(String userId, String userName, String portraitUrl) {
        this.userId = userId;
        this.userName = userName;
        this.portraitUrl = portraitUrl;
    }

    protected UserCard(Parcel in) {
        userId = in.readString();
        userName = in.readString();
        portraitUrl = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(userId);
        dest.writeString(userName);
        dest.writeString(portraitUrl);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<UserCard> CREATOR = new Creator<UserCard>() {
        @Override
        public UserCard createFromParcel(Parcel in) {
            return new UserCard(in);
        }

        @Override
        public UserCard[] newArray(int size) {
            return new UserCard[size];
        }
    };

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPortraitUrl() {
        return portraitUrl;
    }

    public void setPortraitUrl(String portraitUrl) {
        this.portraitUrl = portraitUrl;
    }

    @Override
    public String toString() {
        return userId + "," + userName + "," + portraitUrl;
    }

}
